
//
//  NativeMapViewController.m
//  UILbrary
//
//  Created by mac on 17/3/7.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "NativeMapViewController.h"

@interface NativeMapViewController ()
@property (nonatomic, strong) NSArray *titleArr;
@property (nonatomic, strong) NSArray *viewControllers;
@end

@implementation NativeMapViewController

#pragma mark - life cycle
- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.tableFooterView = [UIView new];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];

    
}





#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return self.titleArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    cell.textLabel.text = self.titleArr[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    UIViewController *vc = [NSClassFromString(self.viewControllers[indexPath.row]) new];
    [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark - lazy
- (NSArray *)titleArr{
    if (!_titleArr) {
        _titleArr = @[@"画圈",@"自定义气泡",@"画历史轨迹"];
    }
    return _titleArr;
}

- (NSArray *)viewControllers{
    if (!_viewControllers) {
        _viewControllers = @[
                        @"MKMapViewController",
                        @"CustomAnnotationMapViewController",
                        @"MKMapDrawLineViewController"];
    }
    return _viewControllers;
}

@end
